package org.yangspring;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author Frankie Yang on 2017/11/22.
 */

@EnableWebMvc
@Configuration
public class FrankieWebConfigAdpt extends WebMvcConfigurerAdapter {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {

        System.out.println("\n\n\n\n\n\n\n\nfrankieView\n\n\n\n\n\n\n\n\n\n\nfrankieView\n\n\n\n\n\nfrankieView\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfrankieView\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");

        System.out.println("\n\nFrankieWebConfig FrankieWebConfig\n\n");
        registry.addViewController("/fv").setViewName("frankieView");
    }

    /***
     * 配置Xml方式：
     * <mvc:view-controller path="/ooxx" view-name="frankieView"/>
     * */
}